<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Title</title>
    <style>
        img{
            display: block;
            width: 200px;
            height: 200px;
        }
    </style>
</head>
<body>
<div id="app">
    
    <div>
        <button @click="toggle">切换</button>
    </div>
    <template v-if="isShowCode">
        <img src="https://game.gtimg.cn/images/yxzj/web201706/images/comm/floatwindow/wzry_qrcode.jpg" alt="">
    </template>
    <div v-show="isShowCode">
        <img src="https://game.gtimg.cn/images/yxzj/web201706/images/comm/floatwindow/wzry_qrcode.jpg" alt="">
    </div>
</div>
<script src="https://unpkg.com/vue@3"></script>
<script>
    const app=Vue.createApp({
        data(){
            return{
                isShowCode:true
            }
        },
        methods:{
            toggle(){
                this.isShowCode=!this.isShowCode
            }
        }
    })
    
    app.mount("#app")
</script>
</body>
</html>